﻿@model CEIT.MVC3.Web.Controllers.ViewModels.CultoViewModel
@{
    ViewBag.Title = "Lançamentos do Culto";
    Layout = "~/Views/Shared/_LayoutLogado.cshtml";
}
@using (Html.BeginForm())
{
    <center>@Html.ValidationSummary(true, "Atenção!")</center>
        
    <fieldset>
        <legend>Ofertas</legend>
        @if (Model.DtRetroativa.HasValue)
        {
            <div class="data-retroativa">
                @Html.LabelFor(model => model.DtRetroativa)
                @Html.DisplayFor(model => model.DtRetroativa.Value)
            </div>
        }
        <div class="align-column two">
            <div class="">
                <div class="editor-label">
                    @Html.LabelFor(model => model.Oferta.DtLancamento)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Oferta.DtLancamento, new { @class = "datepicker" })
                </div>
            </div>
            <div class="">
                <div class="editor-label">
                    @Html.LabelFor(model => model.Oferta.VlLancamento)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Oferta.VlLancamento, new { @class = "decimal" })
                </div>
            </div>
        </div>
        <div class="align-column two">
            <div class="editor-label">
                @Html.LabelFor(model => model.Oferta.DsObservacao)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.Oferta.DsObservacao, new { rows = "4", style = "width:98%" })
            </div>
        </div>
    </fieldset>
    
    <fieldset>
        <legend>Dízimos</legend>
        <div id="dizimos" class="editor-field">
               @{Html.RenderPartial("_DizimosCulto", Model);}
        </div>
        <input id="add-dizimo" type="button" class="icon-plus"  title="Adicionar Dízimos" />
    </fieldset>
        
    <p>
        <input type="submit" value="Finalizar" class="btn-gold" />
        <span>&nbsp;</span>
        <a onclick="javascritp:window.history.back(1);" class="btn-gold">Voltar</a>
    </p>
    
}
@section Style {
    <style type="text/css">
        .novoDizimista { clear: both; }
    </style>
}
@section Script{
    <script type="text/javascript">

        $("#add-dizimo").click(function () {
            $("#dizimos").load('@Url.Action("AddDizimo")' + '?' + $("form").serialize());
        });

        function ExcluirDizimo(tr) {
            $("#" + tr).css('display', 'none');
            $("#" + tr + " input[type='hidden'].IsExcluido").val(true);
        };
    </script>
}
